package 第9场小白入门赛;
import java.io.*;
import java.util.*;
public class _1盖印章 {
public static void main(String[] args) throws IOException {
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        StringTokenizer st = new StringTokenizer(br.readLine());
        
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int count = 0; 
        String t;
        for(int i = 0 ; i < n ; i++) {
            t = br.readLine();
            for(int j = 0; j < m; j++) {
                if(t.charAt(j) == '1') {
                    count++;
                }
            }
        }
        
        int a = count - 2 * k;
        int b = k - a;
        
        System.out.println(a + " " + b);
        
    }
}
